package com.station.search.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.station.search.domain.StationInfo;
import com.station.search.mapper.StationInfoMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author: JT
 * @date: 2021/8/31
 * @Title:
 */
@Service
public class StationInfoServiceImpl extends ServiceImpl<StationInfoMapper, StationInfo> implements StationInfoService{

    @Resource
    private StationInfoMapper stationInfoMapper;

    @Override
    public void modifyStationInfoByStationId(StationInfo stationInfo) {
        this.update(
                stationInfo,
                new QueryWrapper<>(stationInfo)
                        .eq("STATION_CODE", stationInfo.getStationCode())
        );
    }

    @Override
    public void saveStationInfo(StationInfo stationInfo) {
        stationInfoMapper.saveStationInfo(stationInfo);
    }
}
